﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ScrumTime.Models.User>" %>


<script runat="server" type="text/C#">
    String GetSprintId() { 
        return ScrumTime.Helpers.SessionHelper.GetCurrentSprintId( Model.UserName, this.Session).ToString();
    }
</script>

    <div style="margin-top:0px;margin-left:0px;">
        <div id="Div3" style="height:34px;width:960px;background-color:#fff;
            font-family:Verdana;font-size:12px;padding-top:6px;border-top:2px solid #999;border-left:2px solid #999;border-right:2px solid #999;">
            <div style="position:absolute;left:30px;width:265px;margin-top:10px">
            </div>            
            <div style="position:absolute;left:470px;width:80px;margin-top:0px;color:#79a52c;font-weight:bold;
                letter-spacing:1px;font-size:13px;text-align:left;">Tasks</div>            
        </div>       
        <table style="width:964px;font-family:Verdana;padding:0;border:2px solid #999;height:30px;margin-left:0px;
            background-color:#f3f3f3;font-size:12px;color:#666;" cellpadding="0" cellspacing="0">
            <tr>
                <th style="text-align:left;width:100px;border:0px;background-color:#f3f3f3;">Story</th>
                <th style="text-align:left;width:400px;border:0px;background-color:#f3f3f3;">Task Description</th>  
                <th style="text-align:left;width:100px;border:0px;background-color:#f3f3f3;">Hours</th>  
                <th style="width:30px;border:0px;background-color:#f3f3f3;"></th>
            </tr>
        </table>
        <div id="userContentListId" style="width:960px;height:438px;border-left:2px solid #999;border-right:2px solid #aaa;
            border-bottom:2px solid #999;overflow:scroll;">
            
            <table id="userTable" style="width:943px;font-family:Verdana;padding:0" cellpadding="0" cellspacing="0">                
                <tbody id="userTableBody" style="font-size:12px;">
                 <%            
                int sprintId = ScrumTime.Helpers.SessionHelper.GetCurrentSprintId( Model.UserName, this.Session);
                foreach (ScrumTime.Models.Task myTask in Model.Tasks) { 
                    if ( myTask.Story.SprintId == sprintId ){
                %>
                    <tr  class="userRow">
                        <td style="vertical-align:middle;text-align:left;width:100px;border:2px;font-size:11px;">
                                <%: myTask.Story.UserDefinedId %>
                        </td>
                        <td style="vertical-align:middle;text-align:left;width:400px;border:2px;padding-left:8px;padding-right:8px;font-size:11px;">
                                <%: myTask.Description %>
                        </td>
                        <td style="vertical-align:middle;text-align:left;width:100px;border:2px;font-size:11px;">
                                <%: myTask.Hours.ToString() %>
                        </td>                        
                        <td style="width:30px;border:0px;background-color:#f3f3f3;"></td>  
                    </tr>
                <%
                    }
                }
                 %>             
                </tbody>
            </table>
        </div>       
    </div>


<script type="text/javascript">
   var sprintId = <%:GetSprintId()%>;
   if ( sprintId == -1 ){
        alert("the sprint is not selected");
   }
</script>

